package com.example.backend.exception;

import com.example.backend.enums.ResultCodeEnum;
import io.jsonwebtoken.JwtException;

/**
 * 自定义 JWT 过期异常
 */
public class JwtExpiredException extends JwtException {
    private final int code;

    public JwtExpiredException(String msg) {
        super(msg);
        this.code = ResultCodeEnum.TOKEN_EXPIRED.getCode();
    }

    public JwtExpiredException(String msg, Throwable cause) {
        super(msg, cause);
        this.code = ResultCodeEnum.TOKEN_EXPIRED.getCode();
    }

    public JwtExpiredException(int code, String message) {
        super(message);
        this.code = code;
    }
}
